/*****************************************************
* System setting Infomation
*****************************************************/

#ifndef __SYS_CONFIG_INFO_H
#define __SYS_CONFIG_INFO_H

#include <iostream>
#include <string>
#include <vector>
#include <map>

using namespace std;

////////// command type
#define CMD_CONNECT 			0x01
#define CMD_BIND 				0x02
#define CMD_UDP_ASSOCIATE 		0x03

/**********************************************
* SystemConfigInfo
***********************************************/
class SystemConfigInfo
{
private:
	static vector<char> m_socksValidMethods;
	static map<string, string> m_userToPwd;
	/* "remoteInfo : port" */
	static vector<string> m_ConnRuleSvr;
	/* "remoteInfo : port" */
	static vector<string> m_BindRuleSvr;
	/* "remoteInfo : port" */
	static vector<string> m_UPDRuleSvr;
	/* socks protocol version (05) */
	static int m_version;

public :
	static bool IsValidMethod(char method);
	static bool IsValidUser(string userCode, string password);
	static bool IsPermitedSvr(int type, string rmotInfo, uint16_t port);
	static char getSelectedMethod(char numMethod,char* methods);
	static int getVersion(){return m_version;}

public :
	static bool readSysConfigInfo(string path);
	
};

#endif
